package com.sovphone.clevertools

import java.text.SimpleDateFormat
import java.util.*
import java.util.logging.SimpleFormatter

/**
 * Author tianwei
 * Date：2020/12/4 15:53
 *
 * Description:
 */
object DateUtils {
    fun format(time: Long, format: String = "yyyy/MM/dd HH:mm:ss"): String {
        val sf = SimpleDateFormat(format)
        return sf.format(time)
    }

    fun parse(date: String): Long {
        val sf = SimpleDateFormat("yyyy-MM-dd HH:mm")
        return sf.parse(date).time
    }
}